<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<form id="pagerForm" method="post" action="<%=basePath%>supplier_findSuppliers.action"> <!-- 此action指定的是排序、分页所提交的action -->
	<input type="hidden" name="status" value="${param.status}"/>
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum" value="${requestScope.pageNum}" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
	<!-- 存放搜索条件 -->
	<input type="hidden" name="supplierSearch.channelName" value="${requestScope.supplierSearch.channelName}" />
	<input type="hidden" name="supplierSearch.companyName" value="${requestScope.supplierSearch.companyName}" />
	<input type="hidden" name="supplierSearch.channelLevel" value="${requestScope.supplierSearch.channelLevel}" />
	<input type="hidden" name="simpleBean.channelMode" value="${requestScope.supplierSearch.contact}" />
	<input type="hidden" name="simpleBean.channelClass" value="${requestScope.supplierSearch.collectionName}" />
</form>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="<%=basePath%>supplier_findSuppliers.action?numPerPage=10&pageNum=1&orderField=P_C_LINE_ID&orderDirection=asc" method="post">
	<div class="searchBar">
				<div class="pageFormContent1">
					<p>
					<label width="50">渠道名称：</label>
					<input type="text" name="supplierSearch.channelName" value="${requestScope.supplierSearch.channelName}" />
					</p>
					<p>
					<label>供应商公司：</label>
					<input type="text" name="supplierSearch.companyName" value="${requestScope.supplierSearch.companyName}" />
					</p>
					<p>
				    <label>渠道级别：</label>
					<select id="level_su" name="supplierSearch.channelLevel" class=" combox">
					<option value="" selected>全部</option>
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					</select>
					</p>
					<p>
					<label>联系人：</label>
					<input type="text" name="supplierSearch.contact" value="${requestScope.supplierSearch.contact}" />
					</p>
					<p>
					<label>渠道采购人员：</label>
					<input type="text" name="supplierSearch.collectionName" value="${requestScope.supplierSearch.collectionName}" />
					</p>
				</div>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">&nbsp;&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;&nbsp;</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<%=basePath%>supplier_readAdd.action" target="navTab" title="添加供应商" width="500" height="400" rel="addSupplier"><span>添加供应商</span></a></li>
			<li><a class="edit" href="<%=basePath%>supplier_findSupplierByNum.action?supplierNum={sid_user}" target="navTab" rel="modifySupplier"><span>修改供应商信息</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="194">
		<thead>
			<tr>
				<th width="30"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="120" orderField="P_C_LINE_NAME" class="${requestScope.orderDirection }">渠道名称</th>
				<th width="150" orderField="P_C_LINE_COMPANY" class="${requestScope.orderDirection }">供应商公司名</th>
				<th width="50" orderField="P_C_LINE_CLASS" class="${requestScope.orderDirection }">渠道级别</th>
				<th width="100" orderField="P_C_LINE_CONTACT" class="${requestScope.orderDirection }">联系人</th>
				<th width="80">联系地址</th>
				<th width="80">电话</th>
				<th width="80" orderField="P_C_LINE_CN_NAME" class="${requestScope.orderDirection }">渠道采集人员</th>
				<th width="100" orderField="P_C_LINE_ADD_DATE" class="${requestScope.orderDirection }">添加日期</th>
				<th width="100" orderField="STAFF_NUMBER" class="${requestScope.orderDirection }">添加人员</th>
			</tr>
		</thead>
		<tbody id="channelTbody">
		<c:forEach items="${requestScope.supplierList}" var="supplier" varStatus="varStatus">
			<tr target="sid_user" rel="${supplier.PChannelNumber}">
				<td><input name="ids" value="${supplier.PChannelNumber}" type="checkbox"></td>
				<td>${supplier.PCLineName}</td>
				<td>${supplier.PCLineCompany}</td>
				<td>${supplier.PCLineClass}</td>
				<td>${supplier.PCLineContact}</td>
				<td>${supplier.PCLineAddress}</td>
				<td>${supplier.PCLineTel}</td>
				<td>${supplier.PCLineCnName}</td>
				<td>${supplier.PCLineAddDate}</td>
				<td>${supplier.staffNumber}</td>
			</tr>
		</c:forEach>

		</tbody>
	</table>
	<div class="panelBar" name="supp" id="supp" >
		<div class="pages">
			<span>显示</span>
			<select id="countSelect" class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"  >
				<option value="10">10</option>
				<%--<option value="50">50</option>	
				<option value="100">100</option>
			--%></select>
			<span>条，共${requestScope.totalRecords}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="${requestScope.totalRecords}" numPerPage="${requestScope.pageSize}" pageNumShown="${requestScope.totalPages}" currentPage="${requestScope.pageNum }"></div>

	</div>
</div>
<script type="text/javascript">
	(function () {
		var a = document.getElementById("countSelect");
		switch(${requestScope.numPerPage}){
			case 10:
				a.options.selectedIndex = 0;
				break;
			case 50:
				a.options.selectedIndex = 1;
				break;
			case 100:
				a.options.selectedIndex = 2;
				break;
		}
		document.getElementById("level_su").value = "${requestScope.supplierSearch.channelLevel}";
	})();
</script>